Skip to content

Snyk PR Check Experience#25

Open
schottsfired wants to merge 2 commits intopr-check-experiencefrom
pr-check-experience3
Open

Snyk PR Check Experience#25
schottsfired wants to merge 2 commits intopr-check-experiencefrom
pr-check-experience3

Conversation

@schottsfired
Copy link
Copy Markdown
Owner

Added app implementation... hope it's secure 🤞

@schottsfired
Copy link
Copy Markdown
Owner Author

schottsfired commented Jul 15, 2025

Snyk checks have failed. 5 issues have been found so far.

Icon Severity Issues
Critical 0
High 2
Medium 2
Low 1

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

code/snyk check is complete. 5 issues have been found. (View Details)

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

app.set('view engine', 'ejs');
app.use(logger('dev'));
app.use(methodOverride());
app.use(session({
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  Hardcoded Secret

Avoid hardcoding values that are meant to be secret. Found a hardcoded string used in express-session.

Line 42 | CWE-547 | Priority score 834
Data flow: 2 steps

Step 1

secret: 'keyboard cat',

Step 2

app.use(session({

⚡ Fix this issue by replying with the following command: @snyk /fix

app.use(errorHandler());
}

var token = 'SECRET_TOKEN_f8ed84e8f41e4146403dd4a6bbcea5e418d23a9';
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  Hardcoded Secret

Avoid hardcoding values that are meant to be secret. Found a hardcoded string used in here.

Line 83 | CWE-547 | Priority score 834
Data flow: 2 steps

Step 1 - 2

var token = 'SECRET_TOKEN_f8ed84e8f41e4146403dd4a6bbcea5e418d23a9';

⚡ Fix this issue by replying with the following command: @snyk /fix

var token = 'SECRET_TOKEN_f8ed84e8f41e4146403dd4a6bbcea5e418d23a9';
console.log('token: ' + token);

http.createServer(app).listen(app.get('port'), function () {
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  Cleartext Transmission of Sensitive Information

http.createServer uses HTTP which is an insecure protocol and should not be used in code due to cleartext transmission of information. Data in cleartext in a communication channel can be sniffed by unauthorized actors. Consider using the https module instead.

Line 86 | CWE-319 | Priority score 567

⚡ Fix this issue by replying with the following command: @snyk /fix

var cons = require('consolidate');
const hbs = require('hbs')

var app = express();
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  Cross-Site Request Forgery (CSRF)

CSRF protection is disabled for your Express app. This allows the attackers to execute requests on a user's behalf.

Line 28 | CWE-352 | Priority score 367 | Learn more about this vulnerability

⚡ Fix this issue by replying with the following command: @snyk /fix

app.use(session({
secret: 'keyboard cat',
name: 'connect.sid',
cookie: { path: '/' }
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  Sensitive Cookie in HTTPS Session Without 'Secure' Attribute

Cookie misses the Secure attribute (it is false by default). Set it to true to protect the cookie from man-in-the-middle attacks.

Line 45 | CWE-614 | Priority score 417

⚡ Fix this issue by replying with the following command: @snyk /fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants